package com.zsrt.java.model.proxy2;

public class ProxyTest {
	
	public static void main(String[] args) {
		
		//创建一个目标对象StudentDaoImpl
		StudentDao dao=new StudentDaoImpl();
		
		//2创建代理的对象
		StudentDaoProxy proxy=new StudentDaoProxy(dao);
		
	    Object obj = proxy.getProxyInstance();
	    
	    StudentDao daoProxy=(StudentDao)obj;
	    
	    //让代理对象去干活
	    int jg = daoProxy.add(1, 2);
	    
	    System.err.println(jg);
	    
	    daoProxy.delete();
	        
		
	}

}
